<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>c-model双向数据绑定</title>
</head>
<body>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<div id="app">
    <input type="text" v-model="message" @keyup.enter="get"></input>
    <input type="button" value="修改message" @click="set"></input>
    <h2>{{message}}</h2>
</div>

<script>
    var app = new Vue({
        el:"#app",
        data:{
            message:"黑马程序员"

        },
        methods:{
            get:function () {
                alert(this.message);

            },
            set:function () {
                this.message="酷丁鱼";

            }

        }
    })
</script>
</body>
</html>
